import time
from threading import Thread, Event

event = Event()


def bus():
    print("公交车即将到站")
    time.sleep(5)
    print("公交车已到站")
    event.set()


def people(name):
    print(f"{name}人正在等公交")
    event.wait()
    print(f"{name}已上车")


t1 = Thread(target=bus)
t1.start()

for i in range(1, 10):
    t2 = Thread(target=people, args=(i,))
    t2.start()
